package progetto6.jade;

public class TesterStrategy extends ScoreIndependentStrategy {

	private static final long serialVersionUID = -1355940716364464392L;
	private int wait_a_while;
	private final int gain;
	private int iteration = 0;
	
	public TesterStrategy(int initialWait, int gain) {
		wait_a_while = initialWait;
		this.gain = gain;
	}
	
	@Override
	public Choice getNext() {
		if (iteration == wait_a_while) {
			lastChoice = Choice.C;
			wait_a_while *= gain;
			iteration = 0;
		} else {
			lastChoice = Choice.D;
		}
		iteration++;
		return lastChoice;
	}

	@Override
	public String toString() {
		return "TesterStrategy[Wait:"+wait_a_while+",Gain:"+gain+"]";
	}

}
